//
//  VCTicketSuccess.swift
//  AirlineReservation
//
//  Created by Kevin on 2020/3/13.
//  Copyright © 2020 Kevin. All rights reserved.
//

import UIKit

class VCTicketSuccess: VCBase {
    
    private lazy var ticketSuccessView:TicketSuccessView = {
        let ui = TicketSuccessView()
        ui.frame = CGRect(x: 0, y: realHeight, width: SCREEN_WIDTH, height: SCREEN_HEIGHT - realHeight)
        return ui
    }()
    
    public var money:String?
    
    override func viewDidLoad() {
        super.viewDidLoad()

        init_view()
        init_data()
        init_event()
    }
}

extension VCTicketSuccess {
    
    private func init_event() -> Void {
        ticketSuccessView.complete = {
            self.navigationController?.popToRootViewController(animated: true)
        }
    }
    
    private func init_data() -> Void {
        guard let mon = money else {
            return
        }
        ticketSuccessView.resetMoney = mon
    }
    
    private func init_view() -> Void {
        view.addSubview(ticketSuccessView)
    }
}
